import BaseService from './_BaseService'
import config from "../config";

class WorkPlanService extends BaseService {
  root = window.apiPath + '/work-plans'

  createWorkPlans (entity) {
    let path = this.root + '-apply-users'
    return super.post(path, entity)
      .then(resp => resp)
  }

  editWorkPlans (entity) {
    let path = this.root + '-apply-users'
    return super.put(path, entity)
      .then(resp => resp)
  }

  searchList (query = '', page = 0, pageSize = config.PAGE_SIZE) {
    let path = this.root + '-apply-users' + `-ps?query=${query}&page=${page}&size=${pageSize}`
    return super.get(path)
      .then(resp => resp)
  }
}

export default new WorkPlanService()
